﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>JSON访问例子</title>
	<script type="text/javascript" src="Scripts/jquery-1.4.1.min.js"></script>
<script type="text/javascript">
	function query() {
		$.ajax({
			type: "GET",
			url: "RIA-Web-Services-NorthWindService.svc/json/GetCustomers",
			success: function (data) {
				$("#results").append("<ul>");
				var employees = data.GetCustomersResult.RootResults;
				$.each(employees, function (i, entity) {
					$("#results").append("<li>" + entity.CustomerID + "::" + entity.ContactName + "</li>");
				});
				$("#results").append("</ul>");
				alert("Data received");
			}
		});
	} 
</script>
</head>
<body>
<input id="Button1" type="button" value="json query" onclick="query()"/>
<div id="results"> 
</div>
</body>
</html>
